<template>
  <span :class='{"update-data": !noIconForCol && (isUpdate || isAddNode(data.id))}' :style='columnInfo.classStyle'>{{defaultValue()}}</span>
</template>
<script>
import mix from '../js/mainTable'
export default {
  mixins:[mix],
  computed: {
    showName() {
      return this.data[this.word]
    }
  },
  methods: {
    defaultValue() {
      switch(this.word) {
        case 'plannableStatus':
          return this.$store.state.planTable.allConfig == null ? '' :
                this.$store.state.planTable.allConfig.enumerateLocalList.plannableStatus[this.showName]
        case 'lineNumber':
          return this.dataSource.findIndex(item => item.id == this.data.id)
        case 'durationType':
          return '固定工期'
        case 'lock.locker':
          return this.showName == this.$store.state.planTable.allConfig.currentUser ? this.$store.state.planTable.allConfig.currentUserDisplay : this.showName
        case 'predecessor':
          return this.data.predecessor != undefined ? this.data.predecessor.Type : ''
        default:
          return this.showName
      }
    }
  }
}
</script>
<style scoped>
.edit-content {
    width: 100%;
}
</style>